# 猜数字游戏
# import random
# num = random.randint(1, 10)
# 通过一个布尔类型，确定循环是否继续
# flag = True
# while flag:
#     guess_num = int(input("请输入你猜测的数字："))
#     if guess_num == num:
#         print("恭喜你答对了！")
#         flag = False
#     else:
#         if guess_num > num:
#             print("你猜的数字大了")
#         else:
#             print("你猜的数字小了")

# 案例：表白100天，每天10朵玫瑰花
# i = 1
# while i <= 100:
#     print(f"今天是第{i}天，准备表白...")
#     j = 1
#     while j <= 10:
#         print(f"送小美第{j}玫瑰花")
#         j += 1
#     i += 1
#
# print(f"坚持到了第{i - 1}天，表白成功")

# 案例：给小每表白改成for循环
# for x in range(100):
#     print(f"今天是舔狗表白的第{x}天，准备表白...")
#     for j in range(10):
#         print(f"送小美的第{j}朵玫瑰花")
#
# print(f"坚持了第{x}天")
"""
演示使用while的嵌套循环
打印输出九九乘法表
"""
import random

# i = 1
# while i <= 9:
#     # 定义内层循环变量
#     j = 1
#     while j <= i:
#         print(f"{j} * {i} = {j*i}\t", end='')
#         j +=1
#
#     i += 1
#     print("")

# for i in range(1,10):
#     for j in range(1,i + 1):
#         print(f"{j} * {i} = {j * i}\t", end='')
#
#     print("")

# name = "itheima is a brand of itcast"
# sum = 0
# for x in name:
#     if x == "a":
#         sum += 1
#
# print(f"一共有{sum}个\"a\"字符串")

# for x in range(0,10,2):
#     print(x)

# continue 用法
# for i in range(1,6):
#     print("语句1")
#     for j in range(1, 6):
#         print("语句2")
#         continue
#         print("语句3")
#
#     print("语句4")

# break用法
# for i in  range(1,10):
#     print("语句1")
#     break
#     print("语句2")
#
# print("语句3")


salary = 10000
for i in range(1,21):
    import random
    performance = random.randint(1, 10)
    if performance < 5:
        print(f"员工{i}，绩效分{performance},低于5，不发工资，下一位。")
        continue
    else:
        if salary <= 0:
            print("工资发完了，下个月领取吧")
            break
        salary -= 1000
        print(f"员工{i}发放工资1000元，账户余额还剩{salary}。")